import axios from 'axios'
import { ADD_HOME_LIST, SCROLL } from './actionTypes';
import { fromJS } from 'immutable';
export const addHomeList = (data, page) => ({
    type: ADD_HOME_LIST,
    data: fromJS(data),
    page
})
export const controlScroll = (show) => ({
    type: SCROLL,
    show
    
})
export const getMoreList = (page) => {
    return (dispatch) => {
        axios.get('/api/homeList.json?'+page)
        .then(res=>{
            dispatch(addHomeList(res.data.data, page))
        })
    }
}
